package com.dwxt.cdms.applets;

import com.dwxt.cdms.applets.service.HistoryService;
import com.dwxt.cdms.base.Page;
import com.dwxt.common.base.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * 安博熙老版本
 */
@RequestMapping("/cdms/small")
@RestController
public class HistoryController {

    @Autowired
    private HistoryService historyService;

    /**
     * 老版本小程序首页
     * @param customerId
     * @return
     */
    @RequestMapping("/allHistory")
    public BaseResult allHistory(Integer customerId){
        return historyService.allHistory(customerId);
    }

    /**
     * poct版本 小程序首页
     * @param customerId
     * @return
     */
    @RequestMapping("/index2")
    public BaseResult index2(Integer customerId) throws ParseException {
        return historyService.index2(customerId);
    }

    /**
    * @Description:
    * @Param [customerId]
    * @Return com.dwxt.common.base.BaseResult
    * @Author chendq
    * @Date 2022/2/25
    **/
    @RequestMapping("/historyPage")
    public BaseResult historyPage( Page page,Integer customerId,String type,String equipmentCategory){
        return historyService.historyPage(page,customerId,type,equipmentCategory);
    }


    @RequestMapping("/historySleepPage")
    public BaseResult historySleepPage( Page page,Integer customerId,String equipmentCategory){
        return historyService.historySleepPage(page,customerId,equipmentCategory);
    }


}
